const fs = require('fs');
const path = require('path');

const dist = path.join(__dirname, 'dist');
fs.readFile('./styles/main.min.css' , (err , data) => {
    if (err) {
        throw err;
    } else {
        console.log(data.toString());

        if (!fs.existsSync(dist)) {
            fs.mkdirSync(dist)
        }
        fs.writeFile(dist+'/main.min.css', data.toString() , (err) => {
            if (err) throw err
            console.log('成功')
        })
    }
})
